/*
 * com.toone.web.authfinger.config  2015-5-26
 *
 * Copyright 2010 Shenzhen TYDIC Information Technology Co.,Ltd.
 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 
 */
package top.suven.base.common.util;

/** 
 * @ClassName: RedFingerProtocolVersion 
 * @Description: TODO(这里用一句话描述这个类的作用) 
 * @author Carson yuchanghong@tydic.com 
 * @date 2015-5-26 下午5:27:33 
 *  
 */
public class RedFingerProtocolVersion {
	private String protocol;
	
	private int firstVersion;
	private int secondVersion;
	private int thirdVersion;

	/** 
	 * @return protocol 
	 */
	public String getProtocol() {
		return protocol;
	}


	/** 
	 * @param protocol 要设置的 protocol 
	 */
	public void setProtocol(String protocol) {
		this.protocol = protocol;
	}


	/** 
	 * @return firstVersion 
	 */
	public int getFirstVersion() {
		return firstVersion;
	}


	/** 
	 * @param firstVersion 要设置的 firstVersion 
	 */
	public void setFirstVersion(int firstVersion) {
		this.firstVersion = firstVersion;
	}


	/** 
	 * @return secondVersion 
	 */
	public int getSecondVersion() {
		return secondVersion;
	}


	/** 
	 * @param secondVersion 要设置的 secondVersion 
	 */
	public void setSecondVersion(int secondVersion) {
		this.secondVersion = secondVersion;
	}


	/** 
	 * @return thirdVersion 
	 */
	public int getThirdVersion() {
		return thirdVersion;
	}


	/** 
	 * @param thirdVersion 要设置的 thirdVersion 
	 */
	public void setThirdVersion(int thirdVersion) {
		this.thirdVersion = thirdVersion;
	}

	public RedFingerProtocolVersion(String[] version){
		firstVersion = Integer.valueOf(version[0]);
		secondVersion = Integer.valueOf(version[1]);
		thirdVersion = Integer.valueOf(version[2]);
	}

	public boolean checkVersion(int _firstVersion, int _secondVersion, int _thirdVersion) {
		if(firstVersion > _firstVersion){
			return false;
		}else if(firstVersion < _firstVersion){
			return true;
		}
		
		if(secondVersion > _secondVersion){
			return false;
		}else if(secondVersion < _secondVersion){
			return true;
		}
		
		if(thirdVersion > _thirdVersion){
			return false;
		}else if(thirdVersion < _thirdVersion){
			
		}
		
		return true;
	}
}
